#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
创建安装包压缩文件
"""

import os
import zipfile
from datetime import datetime

def create_installer_zip():
    """创建安装包压缩文件"""
    print("创建安装包压缩文件...")
    
    # 创建压缩文件名
    timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
    zip_filename = f"音视频分离工具_安装包_{timestamp}.zip"
    
    # 创建压缩文件
    with zipfile.ZipFile(zip_filename, 'w', zipfile.ZIP_DEFLATED) as zipf:
        # 添加文件到压缩包
        installer_dir = "installer"
        for root, dirs, files in os.walk(installer_dir):
            for file in files:
                file_path = os.path.join(root, file)
                arc_name = os.path.relpath(file_path, installer_dir)
                zipf.write(file_path, arc_name)
                print(f"  添加: {arc_name}")
    
    print(f"✓ 安装包创建成功: {zip_filename}")
    return zip_filename

if __name__ == "__main__":
    create_installer_zip() 